//
//  CGroupInfoView.m
//  wanzhaoIM
//
//  Created by liuyuantao on 15/6/1.
//  Copyright (c) 2015年 liuyuantao. All rights reserved.
//

#import "CGroupInfoView.h"

@interface CGroupInfoView()

@end


@implementation CGroupInfoView

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    self.icon.frame = CGRectMake(0, 13.0f, 55.0f, 55.0f);
    CGPoint iconCenter = self.icon.center;
    iconCenter.x = self.frame.size.width / 2.0f;
    self.icon.center = iconCenter;
    self.hongdianIcon.frame = CGRectMake(0, 13.0f, 7.0f, 7.0f);
    
    CGFloat y = self.icon.frame.size.height / 2.0f - self.hongdianIcon.frame.size.height / 2.0f;
    CGFloat length = self.icon.frame.size.width / 2.0f + self.hongdianIcon.frame.size.width / 2.0f;
    CGFloat x = sqrtf(length * length - y * y);
    self.hongdianIcon.center = CGPointMake(self.icon.center.x + x, 13.0f + self.hongdianIcon.frame.size.height / 2.0f);
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
    // Drawing code
}
*/

@end
